function FMPServ(errObj) { this.reporterr = function reporterr() { var eo = window.errObj; if ( eo != null ) { var err = eo.code; if ( err != null ) { var errors = new this.buildErrs(); var output = null; var erref = "e" + err; var re = eo.reason; if (errors[erref] != null) { if (errors[erref][re] != null) { output = errors[erref][re]; } else { output = errors[erref]; } } else { output = errors.def; } if ( output != null ) alert( output ); if( errors.http == false ) { switch( err ) { case 112: case 211: case 802: case 812: top.location = eo.path + "-home"; break; default: window.location = eo.path + "-open"; break; } } else { switch( err ) { case 400: if( eo.reason == 12 ) { if( window.name == "iwp_sort" ) { if (window.iwp != null) window.iwp.goHome(); window.close(); } top.location = eo.path + "-home"; break; } window.location = eo.path + "-open"; break; case 403: case 404: this.writeToBody( output ); break; default: window.location = eo.path + "-open"; break; } } } } } this.writeToBody = function writeToBody( out ) { if ( out != null ) { var lines = out.split("\r"); var body = document.body; for( var i in lines ) { var h1 = document.createElement("h1") var txt = document.createTextNode(lines[i]); h1.appendChild(txt); body.appendChild(h1); } } } this.buildErrs = function buildErrs() { this.paramtext = function paramtext(dest,c1,c2) { var output = ""; if ( dest != null ) { output += this.replaceparm(dest,c1,1); if (c2 != null) output += this.replaceparm(dest,c2,2); } return output; } this.replaceparm = function replaceparm(dest,src,i) { var index = dest.indexOf("^" + i); if ( index > -1 ) { if ( src == null ) src = ""; return ( dest.substring(0, index) + src + dest.substring(index + 2, dest.length) ); } else return dest; } var eo = window.errObj; var errs = window.errs; if ( eo != null && errs != null ) { this.def = this.paramtext ( errs.e_default, eo.code ); if( errs.http ) { this.http = true; this.e200 = [ errs.e_200_0 ]; this.e204 = [ this.paramtext ( errs.e_204_0, eo.cause ) ]; this.e400 = [ errs.e_400_0, errs.e_400_1, this.paramtext ( errs.e_400_2, eo.cause ), this.paramtext ( errs.e_400_3, eo.cause ), this.paramtext ( errs.e_400_4, eo.cause ), this.paramtext ( errs.e_400_5, eo.cause ), this.paramtext ( errs.e_400_6, eo.cause ), errs.e_400_7, errs.e_400_8, errs.e_400_9, this.paramtext ( errs.e_400_10, eo.cause ), this.paramtext ( errs.e_400_11, eo.cause ), errs.e_400_12 ]; this.e403 = [ errs.e_403_0, errs.e_403_1 ]; this.e404 = [ this.paramtext ( errs.e_404_0, eo.cause ) ]; this.e415 = [ errs.e_415_0 ]; this.e417 = [ this.paramtext ( errs.e_417_0, eo.cause ) ]; this.e500 = [ errs.e_500_0, this.paramtext ( errs.e_500_1, eo.cause ), this.paramtext ( errs.e_500_2, eo.cause ) ]; this.e501 = [ errs.e_501_0 ]; this.e505 = [ errs.e_505_0 ]; this.e20604 = [ errs.e_20604 ]; } else { this.http = false; this.e6 = [ errs.e_6_0 ]; this.e100 = [ this.paramtext( errs.e_100_0, eo.cause ) ]; this.e101 = [ errs.e_101_0 ]; this.e102 = [ errs.e_102_0 ]; this.e103 = [ errs.e_103_0 ]; this.e105 = [ this.paramtext( errs.e_105_0, eo.cause ) ]; this.e200 = [ this.paramtext( errs.e_200_0, eo.cause ) ]; this.e201 = [ this.paramtext( errs.e_201_0, eo.cause ) ]; this.e202 = [ this.paramtext( errs.e_202_0, eo.cause ) ]; this.e201[1] = this.e202[0]; this.e211 = [ errs.e_211_0 ]; this.e301 = [ errs.e_301_0 ]; this.e301[1] = this.e301[0]; this.e302 = [ errs.e_302_0 ]; this.e306 = [ errs.e_306_0, errs.e_306_0 ]; this.e400 = [ errs.e_400_0 ]; this.e401 = [ this.paramtext ( errs.e_401_0, eo.cause ) ]; this.e415 = [ errs.e_415_0 ]; this.e509 = (eo.cause == "") ? [ errs.e_509_1 ] : [ this.paramtext( errs.e_509_0, eo.cause ) ]; var entry = [ errs.entry_0, errs.entry_1 ]; var tmp = this.paramtext( errs.e_500_0, eo.cause ); this.e500 = (eo.cause == "") ? [ entry[0]+errs.e_500_1, entry[1]+errs.e_500_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; tmp = this.paramtext( errs.e_501_0, eo.cause ); this.e501 = (eo.cause == "") ? [ entry[0]+errs.e_501_1, entry[1]+errs.e_501_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; tmp = this.paramtext( errs.e_502_0, eo.cause ); this.e502 = (eo.cause == "") ? [ entry[0]+errs.e_502_1, entry[1]+errs.e_502_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; tmp = this.paramtext( errs.e_503_0, eo.cause ); this.e503 = (eo.cause == "") ? [ entry[0]+errs.e_503_1, entry[1]+errs.e_503_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; tmp = this.paramtext( errs.e_504_0, eo.cause ); this.e504 = (eo.cause == "") ? [ entry[0]+errs.e_504_1, entry[1]+errs.e_504_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; tmp = this.paramtext( errs.e_505_0, eo.cause ); this.e505 = (eo.cause == "") ? [ entry[0]+errs.e_505_1, entry[1]+errs.e_505_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; tmp = this.paramtext( errs.e_506_0, eo.cause ); this.e506 = (eo.cause == "") ? [ entry[0]+errs.e_506_1, entry[1]+errs.e_506_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; tmp = this.paramtext( errs.e_507_0, eo.cause ); this.e507 = (eo.cause == "") ? [ entry[0]+errs.e_507_1, entry[1]+errs.e_507_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; tmp = this.paramtext( errs.e_508_0, eo.cause ); this.e508 = (eo.cause == "") ? [ entry[0]+errs.e_508_1, entry[1]+errs.e_508_1 ] : [ entry[0] + tmp, entry[1] + tmp ]; this.e510 = [ entry[0] + errs.e_510_0, entry[1] + errs.e_510_0 ]; this.e511 = (eo.cause == "") ? [ errs.e_511_1 ] : [ this.paramtext ( errs.e_511_0, eo.cause ) ]; this.e511[1] = this.e511[0]; this.e802 = [ errs.e_802_0 ]; this.e803 = [ this.paramtext( errs.e_803_0, eo.cause ) ]; this.e812 = [ errs.e_812_0 ]; this.e20604 = [ errs.e_20604 ]; } } } } function setup() { if ( window.fmpserver != null ) window.fmpserver.reporterr(); } if ( window.fmpserver == null ) { var eo = window.errObj; if ( eo != null ) window.fmpserver = new FMPServ(eo); } //-->